<template>
  <div class="content-box">
    <el-steps :active="currentStep" align-center finish-status="success">
      <el-step
        v-for="step in steps"
        :key="step.title"
        :title="step.title"
        :status="
          (step.title === '副组长审批' && isChargehand == 0) ||
          (step.title === jumpStep && isChargehand === '0')
            ? 'jump'
            : ''
        "
        icon="snowfont icon-cus"
      ></el-step>
    </el-steps>
  </div>
</template>

<script lang="ts" setup>
import { defineProps, PropType } from "vue";
defineProps({
  currentStep: {
    type: Number,
    require: true,
    default: 0
  },
  steps: {
    type: Array as PropType<{ title: string }[]>,
    require: true,
    default: () => []
  },
  isChargehand: {
    default: 1 // （是否经过副组长审批（1：经过、0：不经过））
  },
  jumpStep: {
    type: String,
    default: "副组长审批",
    required: false
  }
});
</script>

<style lang="scss" scoped>
.content-box {
  &:deep .el-step__title {
    font-size: 12px;
  }
  &:deep .el-step__icon.is-icon {
    width: 28px;
  }
  &:deep .is-status {
    font-family: "snowfont" !important;
    // speak: never;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    font-size: 20px;

    /* Better Font Rendering =========== */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  &:deep .el-icon-check {
    color: #85df00;
    &:before {
      content: "\e6b9";
    }
  }

  &:deep .is-process .icon-cus {
    color: #5298ff;
    &:before {
      content: "\e6b8";
    }
  }
  &:deep .is-wait .icon-cus {
    color: #c2cade;
    &:before {
      content: "\e6b7";
    }
  }
  &:deep .is-jump .icon-cus {
    color: #c2cade;
    &:before {
      content: "\e6ba";
    }
  }

  // 文字颜色
  &:deep .el-step__title.is-success {
    color: #495164;
  }
  &:deep .el-step__title.is-process {
    color: #5298ff;
  }
  &:deep .el-step__title.is-wait {
    color: #495164;
  }
  // 线段的颜色
  &:deep .el-step__head.is-success {
    .el-step__line {
      background-color: rgba(133, 223, 0, 0.2);
    }
  }
  &:deep .el-step__head.is-process {
    color: #5298ff; // 图标颜色
    .el-step__line {
      background-color: rgba(82, 152, 255, 0.3);
    }
  }
  &:deep .el-step__head.is-wait {
    .el-step__line {
      background-color: #e4e8f2;
    }
  }
  &:deep .el-step__head.is-jump {
    .el-step__line {
      background-color: rgba(228, 232, 242, 1);
    }
  }
  // 未执行
  // &:deep .el-step__head.is-wait {
  //   // color: #409eff; // 图标颜色
  //   // .el-step__icon.is-text {
  //   //   border-color: #409eff; // 圆圈边框
  //   //   background-color: #fff; // 圆框背景色
  //   //
  //   height: 24px;
  //   .el-step__icon-inner {
  //     display: none;
  //   }
  // }
}
</style>
